﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using System.Web;
using YiSha.Util;
using YiSha.Util.Model;
using YiSha.Entity;
using YiSha.Model;
using YiSha.Admin.Web.Controllers;
using YiSha.Entity.OrganizationManage;
using YiSha.Business.OrganizationManage;
using YiSha.Model.Param.OrganizationManage;
using Microsoft.AspNetCore.Mvc;
using YiSha.Web.Code;

namespace YiSha.Admin.Web.Areas.api.Controllers
{
    [Area("api")]
    public class ContentController : BaseController
    {
        private ContentBLL contentBLL = new ContentBLL();

        #region 获取数据
        [HttpGet]

        public async Task<IActionResult> GetListJson(ContentListParam param)
        {
            TData<List<ContentEntity>> obj = await contentBLL.GetList(param);
            return Json(obj);
        }

        [HttpGet]
        public async Task<IActionResult> GetPageListJson(ContentListParam param, Pagination pagination)
        {
            TData<List<ContentEntity>> obj = await contentBLL.GetPageList(param, pagination);
            return Json(obj);
        }

        [HttpGet]
        public async Task<IActionResult> GetFormJson(long id)
        {
            TData<ContentEntity> obj = await contentBLL.GetEntity(id);
            return Json(obj);
        }

       
        #endregion
    }
}
